{{extend 'layout.html'}}

<div class="module">
	<div class="module-body">	
		<ul class="nav nav-tabs">
			<li class="active"><a href="#modifica" data-toggle="tab">Generali</a></li>
			<li><a href="#test" data-toggle="tab">Test</a></li>
		</ul>
		<div class="tab-content">
			<div class="tab-pane active in" id="modifica">
				{{=grid}}
			</div>
			<div class="tab-pane fade" id="test">						
				<div class="btn-box-row row-fluid">
					<div class="span12">
						<a class="btn-box small span2" href={{=URL('impostazioni', 'index')}}>
							<i class="icon-arrow-left"></i>
							<b>Categorie</b>
						</a>										
						<a class="btn-box small span2" href={{=URL('impostazioni', 'nuovotest', vars={'categoria_test_id':categoria_test.id})}}>
							<i class="icon-plus"></i>
							<b>Aggiungi nuova</b>
						</a>																																					
					</div>
				</div>
				<hr />
				{{for row in rows:}}
					<div class="media stream">
						<a class="media-avatar medium pull-left" href="#">
							<img src="{{=URL('default', 'download', args=row.thumbnail)}}" />
						</a>
						<div class="media-body">
							<div class="stream-headline">
								<h5 class="stream-author">
									{{=row.test}}
								</h5>
								<div class="stream-text">
									{{=XML(row.descrizione)}}
								</div>
							</div>
							<div class="stream-options">
								<a class="btn btn-small" href={{=URL('impostazioni', 'modificatest', vars={'test_id':row["id"]})}}>
									<i class="icon-cog shaded"></i>
									{{=T('Modifica')}}
								</a>
								<button class="btn btn-small" onclick="if (confirm('Sei sicuro?')){ajax('{{=URL('impostazioni', 'eliminatest', vars={'test_id':row['id']})}}',[], null);jQuery(this).parent().parent().parent().hide();}">
									<i class="icon-remove-circle shaded"></i>
									{{=T('Elimina')}}
								</button>
							</div>
						</div>
					</div>
				{{pass}}					
			</div>
		</div>
	</div>
</div>